-GIR_VERSION := d1e88f94e89a84d7aae7a51b3ff46b71838c42ff
+GIR_VERSION := 60cbef05401bd73c3e8a0a7c0cbfb793394acfe7
RUSTDOC_STRIPPER_VERSION := 0.1.9
all: gir
where P: IsA<AsyncProgress>
{
let f: &F = &*(f as *const F);
- f(&AsyncProgress::from_glib_borrow(this).unsafe_cast())
+ f(&AsyncProgress::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"changed\0".as_ptr() as *const _,
- Some(transmute(changed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
+ Some(transmute::<_, unsafe extern "C" fn()>(changed_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
}
use ostree_sys;
use std::ffi::CStr;
-lazy_static! {
- pub static ref COMMIT_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_GVARIANT_STRING).to_str().unwrap()};
-}
+pub static COMMIT_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_GVARIANT_STRING).to_str().unwrap()});
#[cfg(any(feature = "v2018_6", feature = "dox"))]
-lazy_static! {
- pub static ref COMMIT_META_KEY_COLLECTION_BINDING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_COLLECTION_BINDING).to_str().unwrap()};
-}
+pub static COMMIT_META_KEY_COLLECTION_BINDING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_COLLECTION_BINDING).to_str().unwrap()});
#[cfg(any(feature = "v2017_7", feature = "dox"))]
-lazy_static! {
- pub static ref COMMIT_META_KEY_ENDOFLIFE: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ENDOFLIFE).to_str().unwrap()};
-}
+pub static COMMIT_META_KEY_ENDOFLIFE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ENDOFLIFE).to_str().unwrap()});
#[cfg(any(feature = "v2017_7", feature = "dox"))]
-lazy_static! {
- pub static ref COMMIT_META_KEY_ENDOFLIFE_REBASE: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE).to_str().unwrap()};
-}
+pub static COMMIT_META_KEY_ENDOFLIFE_REBASE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE).to_str().unwrap()});
#[cfg(any(feature = "v2017_9", feature = "dox"))]
-lazy_static! {
- pub static ref COMMIT_META_KEY_REF_BINDING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_REF_BINDING).to_str().unwrap()};
-}
+pub static COMMIT_META_KEY_REF_BINDING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_REF_BINDING).to_str().unwrap()});
#[cfg(any(feature = "v2017_13", feature = "dox"))]
-lazy_static! {
- pub static ref COMMIT_META_KEY_SOURCE_TITLE: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_SOURCE_TITLE).to_str().unwrap()};
-}
+pub static COMMIT_META_KEY_SOURCE_TITLE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_SOURCE_TITLE).to_str().unwrap()});
#[cfg(any(feature = "v2014_9", feature = "dox"))]
-lazy_static! {
- pub static ref COMMIT_META_KEY_VERSION: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_VERSION).to_str().unwrap()};
-}
-lazy_static! {
- pub static ref DIRMETA_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_DIRMETA_GVARIANT_STRING).to_str().unwrap()};
-}
-lazy_static! {
- pub static ref FILEMETA_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_FILEMETA_GVARIANT_STRING).to_str().unwrap()};
-}
+pub static COMMIT_META_KEY_VERSION: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_VERSION).to_str().unwrap()});
+pub static DIRMETA_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_DIRMETA_GVARIANT_STRING).to_str().unwrap()});
+pub static FILEMETA_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_FILEMETA_GVARIANT_STRING).to_str().unwrap()});
#[cfg(any(feature = "v2018_9", feature = "dox"))]
-lazy_static! {
- pub static ref META_KEY_DEPLOY_COLLECTION_ID: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_META_KEY_DEPLOY_COLLECTION_ID).to_str().unwrap()};
-}
+pub static META_KEY_DEPLOY_COLLECTION_ID: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_META_KEY_DEPLOY_COLLECTION_ID).to_str().unwrap()});
#[cfg(any(feature = "v2018_3", feature = "dox"))]
-lazy_static! {
- pub static ref ORIGIN_TRANSIENT_GROUP: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_ORIGIN_TRANSIENT_GROUP).to_str().unwrap()};
-}
+pub static ORIGIN_TRANSIENT_GROUP: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_ORIGIN_TRANSIENT_GROUP).to_str().unwrap()});
#[cfg(any(feature = "v2018_6", feature = "dox"))]
-lazy_static! {
- pub static ref REPO_METADATA_REF: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_REPO_METADATA_REF).to_str().unwrap()};
-}
-lazy_static! {
- pub static ref SUMMARY_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_GVARIANT_STRING).to_str().unwrap()};
-}
-lazy_static! {
- pub static ref SUMMARY_SIG_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_SIG_GVARIANT_STRING).to_str().unwrap()};
-}
-lazy_static! {
- pub static ref TREE_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ostree_sys::OSTREE_TREE_GVARIANT_STRING).to_str().unwrap()};
-}
+pub static REPO_METADATA_REF: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_REPO_METADATA_REF).to_str().unwrap()});
+pub static SUMMARY_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_GVARIANT_STRING).to_str().unwrap()});
+pub static SUMMARY_SIG_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_SIG_GVARIANT_STRING).to_str().unwrap()});
+pub static TREE_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_TREE_GVARIANT_STRING).to_str().unwrap()});
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
+#[non_exhaustive]
pub enum DeploymentUnlockedState {
None,
Development,
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
+#[non_exhaustive]
pub enum GpgSignatureAttr {
Valid,
SigExpired,
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
+#[non_exhaustive]
pub enum GpgSignatureFormatFlags {
GpgSignatureFormatDefault,
#[doc(hidden)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
+#[non_exhaustive]
pub enum ObjectType {
File,
DirTree,
#[cfg(any(feature = "v2018_2", feature = "dox"))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
+#[non_exhaustive]
pub enum RepoCheckoutFilterResult {
Allow,
Skip,
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
+#[non_exhaustive]
pub enum RepoCheckoutMode {
None,
User,
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
+#[non_exhaustive]
pub enum RepoCheckoutOverwriteMode {
None,
UnionFiles,
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
+#[non_exhaustive]
pub enum RepoCommitFilterResult {
Allow,
Skip,
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
+#[non_exhaustive]
pub enum RepoCommitIterResult {
Error,
End,
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
+#[non_exhaustive]
pub enum RepoMode {
Bare,
Archive,
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
+#[non_exhaustive]
pub enum RepoPruneFlags {
None,
NoPrune,
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
+#[non_exhaustive]
pub enum RepoRemoteChange {
Add,
AddIfNotExists,
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
+#[non_exhaustive]
pub enum StaticDeltaGenerateOpt {
Lowlatency,
Major,
use ostree_sys;
use std::mem;
use std::ptr;
+use DiffFlags;
+use DiffItem;
use ObjectType;
}
//#[cfg(any(feature = "v2020_1", feature = "dox"))]
-//pub fn commit_get_object_sizes(commit_variant: &glib::Variant, out_sizes_entries: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 21 }) -> Result<(), glib::Error> {
+//pub fn commit_get_object_sizes(commit_variant: &glib::Variant, out_sizes_entries: /*Ignored*/Vec<CommitSizesEntry>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_commit_get_object_sizes() }
//}
}
}
-//pub fn diff_dirs<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(flags: DiffFlags, a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 27 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, cancellable: Option<&R>) -> Result<(), glib::Error> {
-// unsafe { TODO: call ostree_sys:ostree_diff_dirs() }
-//}
+pub fn diff_dirs<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(flags: DiffFlags, a: &P, b: &Q, modified: &[&DiffItem], removed: &[gio::File], added: &[gio::File], cancellable: Option<&R>) -> Result<(), glib::Error> {
+ unsafe {
+ let mut error = ptr::null_mut();
+ let _ = ostree_sys::ostree_diff_dirs(flags.to_glib(), a.as_ref().to_glib_none().0, b.as_ref().to_glib_none().0, modified.to_glib_none().0, removed.to_glib_none().0, added.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+ if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+ }
+}
//#[cfg(any(feature = "v2017_4", feature = "dox"))]
-//pub fn diff_dirs_with_options<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(flags: DiffFlags, a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 27 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, options: /*Ignored*/Option<&mut DiffDirsOptions>, cancellable: Option<&R>) -> Result<(), glib::Error> {
+//pub fn diff_dirs_with_options<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(flags: DiffFlags, a: &P, b: &Q, modified: &[&DiffItem], removed: &[gio::File], added: &[gio::File], options: /*Ignored*/Option<&mut DiffDirsOptions>, cancellable: Option<&R>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_diff_dirs_with_options() }
//}
-//pub fn diff_print<P: IsA<gio::File>, Q: IsA<gio::File>>(a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 27 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }) {
-// unsafe { TODO: call ostree_sys:ostree_diff_print() }
-//}
+pub fn diff_print<P: IsA<gio::File>, Q: IsA<gio::File>>(a: &P, b: &Q, modified: &[&DiffItem], removed: &[gio::File], added: &[gio::File]) {
+ unsafe {
+ ostree_sys::ostree_diff_print(a.as_ref().to_glib_none().0, b.as_ref().to_glib_none().0, modified.to_glib_none().0, removed.to_glib_none().0, added.to_glib_none().0);
+ }
+}
#[cfg(any(feature = "v2017_10", feature = "dox"))]
pub fn gpg_error_quark() -> glib::Quark {
pub use self::repo_file::{RepoFile, RepoFileClass, NONE_REPO_FILE};
pub use self::repo_file::RepoFileExt;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
mod repo_finder;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
pub use self::repo_finder::{RepoFinder, NONE_REPO_FINDER};
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
pub use self::repo_finder::RepoFinderExt;
mod repo_finder_avahi;
pub use super::AsyncProgressExt;
pub use super::MutableTreeExt;
pub use super::RepoFileExt;
+ #[cfg(any(feature = "v2018_6", feature = "dox"))]
pub use super::RepoFinderExt;
pub use super::RepoFinderAvahiExt;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
}
#[cfg(any(feature = "v2018_7", feature = "dox"))]
- pub fn new_from_checksum(repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> MutableTree {
+ pub fn from_checksum(repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> MutableTree {
unsafe {
from_glib_full(ostree_sys::ostree_mutable_tree_new_from_checksum(repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0))
}
fn ensure_dir(&self, name: &str) -> Result<MutableTree, glib::Error>;
- //fn ensure_parent_dirs(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, metadata_checksum: &str) -> Result<MutableTree, glib::Error>;
+ fn ensure_parent_dirs(&self, split_path: &[&str], metadata_checksum: &str) -> Result<MutableTree, glib::Error>;
#[cfg(any(feature = "v2018_7", feature = "dox"))]
fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool;
fn set_metadata_checksum(&self, checksum: &str);
- //fn walk(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, start: u32) -> Result<MutableTree, glib::Error>;
+ fn walk(&self, split_path: &[&str], start: u32) -> Result<MutableTree, glib::Error>;
}
impl<O: IsA<MutableTree>> MutableTreeExt for O {
}
}
- //fn ensure_parent_dirs(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, metadata_checksum: &str) -> Result<MutableTree, glib::Error> {
- // unsafe { TODO: call ostree_sys:ostree_mutable_tree_ensure_parent_dirs() }
- //}
+ fn ensure_parent_dirs(&self, split_path: &[&str], metadata_checksum: &str) -> Result<MutableTree, glib::Error> {
+ unsafe {
+ let mut out_parent = ptr::null_mut();
+ let mut error = ptr::null_mut();
+ let _ = ostree_sys::ostree_mutable_tree_ensure_parent_dirs(self.as_ref().to_glib_none().0, split_path.to_glib_none().0, metadata_checksum.to_glib_none().0, &mut out_parent, &mut error);
+ if error.is_null() { Ok(from_glib_full(out_parent)) } else { Err(from_glib_full(error)) }
+ }
+ }
#[cfg(any(feature = "v2018_7", feature = "dox"))]
fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool {
}
}
- //fn walk(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, start: u32) -> Result<MutableTree, glib::Error> {
- // unsafe { TODO: call ostree_sys:ostree_mutable_tree_walk() }
- //}
+ fn walk(&self, split_path: &[&str], start: u32) -> Result<MutableTree, glib::Error> {
+ unsafe {
+ let mut out_subdir = ptr::null_mut();
+ let mut error = ptr::null_mut();
+ let _ = ostree_sys::ostree_mutable_tree_walk(self.as_ref().to_glib_none().0, split_path.to_glib_none().0, start, &mut out_subdir, &mut error);
+ if error.is_null() { Ok(from_glib_full(out_subdir)) } else { Err(from_glib_full(error)) }
+ }
+ }
}
impl fmt::Display for MutableTree {
// unsafe { TODO: call ostree_sys:ostree_repo_list_refs_ext() }
//}
- //pub fn list_static_delta_names<P: IsA<gio::Cancellable>>(&self, out_deltas: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), glib::Error> {
- // unsafe { TODO: call ostree_sys:ostree_repo_list_static_delta_names() }
- //}
+ pub fn list_static_delta_names<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<Vec<GString>, glib::Error> {
+ unsafe {
+ let mut out_deltas = ptr::null_mut();
+ let mut error = ptr::null_mut();
+ let _ = ostree_sys::ostree_repo_list_static_delta_names(self.to_glib_none().0, &mut out_deltas, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+ if error.is_null() { Ok(FromGlibPtrContainer::from_glib_container(out_deltas)) } else { Err(from_glib_full(error)) }
+ }
+ }
#[cfg(any(feature = "v2015_7", feature = "dox"))]
pub fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, RepoCommitState), glib::Error> {
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"gpg-verify-result\0".as_ptr() as *const _,
- Some(transmute(gpg_verify_result_trampoline::<F> as usize)), Box_::into_raw(f))
+ Some(transmute::<_, unsafe extern "C" fn()>(gpg_verify_result_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
}
let commit_filter_data: Box_<Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = Box_::new(commit_filter);
unsafe extern "C" fn commit_filter_func(repo: *mut ostree_sys::OstreeRepo, path: *const libc::c_char, file_info: *mut gio_sys::GFileInfo, user_data: glib_sys::gpointer) -> ostree_sys::OstreeRepoCommitFilterResult {
let repo = from_glib_borrow(repo);
- let path: GString = from_glib_borrow(path);
+ let path: Borrowed<GString> = from_glib_borrow(path);
let file_info = from_glib_borrow(file_info);
let callback: &Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>> = &*(user_data as *mut _);
let res = if let Some(ref callback) = *callback {
let callback_data: Box_<P> = Box_::new(callback);
unsafe extern "C" fn callback_func<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(repo: *mut ostree_sys::OstreeRepo, path: *const libc::c_char, file_info: *mut gio_sys::GFileInfo, user_data: glib_sys::gpointer) -> *mut glib_sys::GVariant {
let repo = from_glib_borrow(repo);
- let path: GString = from_glib_borrow(path);
+ let path: Borrowed<GString> = from_glib_borrow(path);
let file_info = from_glib_borrow(file_info);
let callback: &P = &*(user_data as *mut _);
let res = (*callback)(&repo, path.as_str(), &file_info);
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
+use gio;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
+use gio_sys;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
+use glib;
use glib::object::IsA;
use glib::translate::*;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
+use glib_sys;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
+use gobject_sys;
use ostree_sys;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
+use std::boxed::Box as Box_;
use std::fmt;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
+use std::pin::Pin;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
+use std::ptr;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
+use CollectionRef;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
+use Repo;
+#[cfg(any(feature = "v2018_6", feature = "dox"))]
+use RepoFinderResult;
glib_wrapper! {
pub struct RepoFinder(Interface<ostree_sys::OstreeRepoFinder>);
}
impl RepoFinder {
- //#[cfg(any(feature = "v2018_6", feature = "dox"))]
- //pub fn resolve_all_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, glib::Error>) + Send + 'static>(finders: &[RepoFinder], refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q) {
- // unsafe { TODO: call ostree_sys:ostree_repo_finder_resolve_all_async() }
- //}
+ #[cfg(any(feature = "v2018_6", feature = "dox"))]
+ pub fn resolve_all_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result<Vec<RepoFinderResult>, glib::Error>) + Send + 'static>(finders: &[RepoFinder], refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q) {
+ let user_data: Box_<Q> = Box_::new(callback);
+ unsafe extern "C" fn resolve_all_async_trampoline<Q: FnOnce(Result<Vec<RepoFinderResult>, glib::Error>) + Send + 'static>(_source_object: *mut gobject_sys::GObject, res: *mut gio_sys::GAsyncResult, user_data: glib_sys::gpointer) {
+ let mut error = ptr::null_mut();
+ let ret = ostree_sys::ostree_repo_finder_resolve_all_finish(res, &mut error);
+ let result = if error.is_null() { Ok(FromGlibPtrContainer::from_glib_full(ret)) } else { Err(from_glib_full(error)) };
+ let callback: Box_<Q> = Box_::from_raw(user_data as *mut _);
+ callback(result);
+ }
+ let callback = resolve_all_async_trampoline::<Q>;
+ unsafe {
+ ostree_sys::ostree_repo_finder_resolve_all_async(finders.to_glib_none().0, refs.to_glib_none().0, parent_repo.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box_::into_raw(user_data) as *mut _);
+ }
+ }
- //
- //#[cfg(any(feature = "v2018_6", feature = "dox"))]
- //pub fn resolve_all_async_future(finders: &[RepoFinder], refs: &[&CollectionRef], parent_repo: &Repo) -> Pin<Box_<dyn std::future::Future<Output = Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, glib::Error>> + 'static>> {
+
+ #[cfg(any(feature = "v2018_6", feature = "dox"))]
+ pub fn resolve_all_async_future(finders: &[RepoFinder], refs: &[&CollectionRef], parent_repo: &Repo) -> Pin<Box_<dyn std::future::Future<Output = Result<Vec<RepoFinderResult>, glib::Error>> + 'static>> {
- //let finders = finders.clone();
- //let refs = refs.clone();
- //let parent_repo = parent_repo.clone();
- //Box_::pin(gio::GioFuture::new(&(), move |_obj, send| {
- // let cancellable = gio::Cancellable::new();
- // Self::resolve_all_async(
- // &finders,
- // &refs,
- // &parent_repo,
- // Some(&cancellable),
- // move |res| {
- // send.resolve(res);
- // },
- // );
+ let finders = finders.clone();
+ let refs = refs.clone();
+ let parent_repo = parent_repo.clone();
+ Box_::pin(gio::GioFuture::new(&(), move |_obj, send| {
+ let cancellable = gio::Cancellable::new();
+ Self::resolve_all_async(
+ &finders,
+ &refs,
+ &parent_repo,
+ Some(&cancellable),
+ move |res| {
+ send.resolve(res);
+ },
+ );
- // cancellable
- //}))
- //}
+ cancellable
+ }))
+ }
}
pub const NONE_REPO_FINDER: Option<&RepoFinder> = None;
pub trait RepoFinderExt: 'static {
- //#[cfg(any(feature = "v2018_6", feature = "dox"))]
- //fn resolve_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, glib::Error>) + Send + 'static>(&self, refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q);
+ #[cfg(any(feature = "v2018_6", feature = "dox"))]
+ fn resolve_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result<Vec<RepoFinderResult>, glib::Error>) + Send + 'static>(&self, refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q);
- //
- //#[cfg(any(feature = "v2018_6", feature = "dox"))]
- //fn resolve_async_future(&self, refs: &[&CollectionRef], parent_repo: &Repo) -> Pin<Box_<dyn std::future::Future<Output = Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, glib::Error>> + 'static>>;
+
+ #[cfg(any(feature = "v2018_6", feature = "dox"))]
+ fn resolve_async_future(&self, refs: &[&CollectionRef], parent_repo: &Repo) -> Pin<Box_<dyn std::future::Future<Output = Result<Vec<RepoFinderResult>, glib::Error>> + 'static>>;
}
impl<O: IsA<RepoFinder>> RepoFinderExt for O {
- //#[cfg(any(feature = "v2018_6", feature = "dox"))]
- //fn resolve_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, glib::Error>) + Send + 'static>(&self, refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q) {
- // unsafe { TODO: call ostree_sys:ostree_repo_finder_resolve_async() }
- //}
+ #[cfg(any(feature = "v2018_6", feature = "dox"))]
+ fn resolve_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result<Vec<RepoFinderResult>, glib::Error>) + Send + 'static>(&self, refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q) {
+ let user_data: Box_<Q> = Box_::new(callback);
+ unsafe extern "C" fn resolve_async_trampoline<Q: FnOnce(Result<Vec<RepoFinderResult>, glib::Error>) + Send + 'static>(_source_object: *mut gobject_sys::GObject, res: *mut gio_sys::GAsyncResult, user_data: glib_sys::gpointer) {
+ let mut error = ptr::null_mut();
+ let ret = ostree_sys::ostree_repo_finder_resolve_finish(_source_object as *mut _, res, &mut error);
+ let result = if error.is_null() { Ok(FromGlibPtrContainer::from_glib_full(ret)) } else { Err(from_glib_full(error)) };
+ let callback: Box_<Q> = Box_::from_raw(user_data as *mut _);
+ callback(result);
+ }
+ let callback = resolve_async_trampoline::<Q>;
+ unsafe {
+ ostree_sys::ostree_repo_finder_resolve_async(self.as_ref().to_glib_none().0, refs.to_glib_none().0, parent_repo.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box_::into_raw(user_data) as *mut _);
+ }
+ }
- //
- //#[cfg(any(feature = "v2018_6", feature = "dox"))]
- //fn resolve_async_future(&self, refs: &[&CollectionRef], parent_repo: &Repo) -> Pin<Box_<dyn std::future::Future<Output = Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, glib::Error>> + 'static>> {
+
+ #[cfg(any(feature = "v2018_6", feature = "dox"))]
+ fn resolve_async_future(&self, refs: &[&CollectionRef], parent_repo: &Repo) -> Pin<Box_<dyn std::future::Future<Output = Result<Vec<RepoFinderResult>, glib::Error>> + 'static>> {
- //let refs = refs.clone();
- //let parent_repo = parent_repo.clone();
- //Box_::pin(gio::GioFuture::new(self, move |obj, send| {
- // let cancellable = gio::Cancellable::new();
- // obj.resolve_async(
- // &refs,
- // &parent_repo,
- // Some(&cancellable),
- // move |res| {
- // send.resolve(res);
- // },
- // );
+ let refs = refs.clone();
+ let parent_repo = parent_repo.clone();
+ Box_::pin(gio::GioFuture::new(self, move |obj, send| {
+ let cancellable = gio::Cancellable::new();
+ obj.resolve_async(
+ &refs,
+ &parent_repo,
+ Some(&cancellable),
+ move |res| {
+ send.resolve(res);
+ },
+ );
- // cancellable
- //}))
- //}
+ cancellable
+ }))
+ }
}
impl fmt::Display for RepoFinder {
}
}
- //pub fn get_deployments(&self) -> /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 22 } {
- // unsafe { TODO: call ostree_sys:ostree_sysroot_get_deployments() }
- //}
+ pub fn get_deployments(&self) -> Vec<Deployment> {
+ unsafe {
+ FromGlibPtrContainer::from_glib_container(ostree_sys::ostree_sysroot_get_deployments(self.to_glib_none().0))
+ }
+ }
pub fn get_fd(&self) -> i32 {
unsafe {
}
}
- //pub fn write_deployments<P: IsA<gio::Cancellable>>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 22 }, cancellable: Option<&P>) -> Result<(), glib::Error> {
- // unsafe { TODO: call ostree_sys:ostree_sysroot_write_deployments() }
- //}
+ pub fn write_deployments<P: IsA<gio::Cancellable>>(&self, new_deployments: &[Deployment], cancellable: Option<&P>) -> Result<(), glib::Error> {
+ unsafe {
+ let mut error = ptr::null_mut();
+ let _ = ostree_sys::ostree_sysroot_write_deployments(self.to_glib_none().0, new_deployments.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+ if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+ }
+ }
//#[cfg(any(feature = "v2017_4", feature = "dox"))]
- //pub fn write_deployments_with_options<P: IsA<gio::Cancellable>>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 22 }, opts: /*Ignored*/&mut SysrootWriteDeploymentsOpts, cancellable: Option<&P>) -> Result<(), glib::Error> {
+ //pub fn write_deployments_with_options<P: IsA<gio::Cancellable>>(&self, new_deployments: &[Deployment], opts: /*Ignored*/&mut SysrootWriteDeploymentsOpts, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_sysroot_write_deployments_with_options() }
//}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"journal-msg\0".as_ptr() as *const _,
- Some(transmute(journal_msg_trampoline::<F> as usize)), Box_::into_raw(f))
+ Some(transmute::<_, unsafe extern "C" fn()>(journal_msg_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
}
-Generated by gir (https://github.com/gtk-rs/gir @ d1e88f94)
-from gir-files (https://github.com/gtk-rs/gir-files @ b20abec)
+Generated by gir (https://github.com/gtk-rs/gir @ 60cbef05)
+from gir-files (https://github.com/gtk-rs/gir-files @ e51adaf)
[build-dependencies]
pkg-config = "0.3.7"
+system-deps = "1.3"
[dependencies]
gio-sys = "0.9.1"
version = "0.5.4"
[package.metadata.docs.rs]
features = ["dox"]
+[package.metadata.system-deps.ostree_1]
+name = "ostree-1"
+version = "0.0"
+
+[package.metadata.system-deps.ostree_1.feature-versions]
+v2014_9 = "2014.9"
+v2015_7 = "2015.7"
+v2016_4 = "2016.4"
+v2016_5 = "2016.5"
+v2016_6 = "2016.6"
+v2016_7 = "2016.7"
+v2016_8 = "2016.8"
+v2016_14 = "2016.14"
+v2017_1 = "2017.1"
+v2017_2 = "2017.2"
+v2017_3 = "2017.3"
+v2017_4 = "2017.4"
+v2017_6 = "2017.6"
+v2017_7 = "2017.7"
+v2017_8 = "2017.8"
+v2017_9 = "2017.9"
+v2017_10 = "2017.10"
+v2017_11 = "2017.11"
+v2017_12 = "2017.12"
+v2017_13 = "2017.13"
+v2017_15 = "2017.15"
+v2018_2 = "2018.2"
+v2018_3 = "2018.3"
+v2018_5 = "2018.5"
+v2018_6 = "2018.6"
+v2018_7 = "2018.7"
+v2018_9 = "2018.9"
+v2019_2 = "2019.2"
+v2019_3 = "2019.3"
+v2019_4 = "2019.4"
+v2019_6 = "2019.6"
+v2020_1 = "2020.1"
// DO NOT EDIT
#[cfg(not(feature = "dox"))]
-extern crate pkg_config;
+extern crate system_deps;
-#[cfg(not(feature = "dox"))]
-use pkg_config::{Config, Error};
-#[cfg(not(feature = "dox"))]
-use std::env;
#[cfg(not(feature = "dox"))]
use std::io::prelude::*;
#[cfg(not(feature = "dox"))]
#[cfg(not(feature = "dox"))]
fn main() {
- if let Err(s) = find() {
- let _ = writeln!(io::stderr(), "{}", s);
+ if let Err(s) = system_deps::Config::new().probe() {
+ let _ = eprintln!("{}", s);
process::exit(1);
}
}
-
-#[cfg(not(feature = "dox"))]
-fn find() -> Result<(), Error> {
- let package_name = "ostree-1";
- let shared_libs = ["ostree-1"];
- let version = if cfg!(feature = "v2020_1") {
- "2020.1"
- } else if cfg!(feature = "v2019_6") {
- "2019.6"
- } else if cfg!(feature = "v2019_4") {
- "2019.4"
- } else if cfg!(feature = "v2019_3") {
- "2019.3"
- } else if cfg!(feature = "v2019_2") {
- "2019.2"
- } else if cfg!(feature = "v2018_9") {
- "2018.9"
- } else if cfg!(feature = "v2018_7") {
- "2018.7"
- } else if cfg!(feature = "v2018_6") {
- "2018.6"
- } else if cfg!(feature = "v2018_5") {
- "2018.5"
- } else if cfg!(feature = "v2018_3") {
- "2018.3"
- } else if cfg!(feature = "v2018_2") {
- "2018.2"
- } else if cfg!(feature = "v2017_15") {
- "2017.15"
- } else if cfg!(feature = "v2017_13") {
- "2017.13"
- } else if cfg!(feature = "v2017_12") {
- "2017.12"
- } else if cfg!(feature = "v2017_11") {
- "2017.11"
- } else if cfg!(feature = "v2017_10") {
- "2017.10"
- } else if cfg!(feature = "v2017_9") {
- "2017.9"
- } else if cfg!(feature = "v2017_8") {
- "2017.8"
- } else if cfg!(feature = "v2017_7") {
- "2017.7"
- } else if cfg!(feature = "v2017_6") {
- "2017.6"
- } else if cfg!(feature = "v2017_4") {
- "2017.4"
- } else if cfg!(feature = "v2017_3") {
- "2017.3"
- } else if cfg!(feature = "v2017_2") {
- "2017.2"
- } else if cfg!(feature = "v2017_1") {
- "2017.1"
- } else if cfg!(feature = "v2016_14") {
- "2016.14"
- } else if cfg!(feature = "v2016_8") {
- "2016.8"
- } else if cfg!(feature = "v2016_7") {
- "2016.7"
- } else if cfg!(feature = "v2016_6") {
- "2016.6"
- } else if cfg!(feature = "v2016_5") {
- "2016.5"
- } else if cfg!(feature = "v2016_4") {
- "2016.4"
- } else if cfg!(feature = "v2015_7") {
- "2015.7"
- } else {
- "0.0"
- };
-
- if let Ok(inc_dir) = env::var("GTK_INCLUDE_DIR") {
- println!("cargo:include={}", inc_dir);
- }
- if let Ok(lib_dir) = env::var("GTK_LIB_DIR") {
- for lib_ in shared_libs.iter() {
- println!("cargo:rustc-link-lib=dylib={}", lib_);
- }
- println!("cargo:rustc-link-search=native={}", lib_dir);
- return Ok(())
- }
-
- let target = env::var("TARGET").expect("TARGET environment variable doesn't exist");
- let hardcode_shared_libs = target.contains("windows");
-
- let mut config = Config::new();
- config.atleast_version(version);
- config.print_system_libs(false);
- if hardcode_shared_libs {
- config.cargo_metadata(false);
- }
- match config.probe(package_name) {
- Ok(library) => {
- if let Ok(paths) = std::env::join_paths(library.include_paths) {
- println!("cargo:include={}", paths.to_string_lossy());
- }
- if hardcode_shared_libs {
- for lib_ in shared_libs.iter() {
- println!("cargo:rustc-link-lib=dylib={}", lib_);
- }
- for path in library.link_paths.iter() {
- println!("cargo:rustc-link-search=native={}",
- path.to_str().expect("library path doesn't exist"));
- }
- }
- Ok(())
- }
- Err(Error::EnvNoPkgConfig(_)) | Err(Error::Command { .. }) => {
- for lib_ in shared_libs.iter() {
- println!("cargo:rustc-link-lib=dylib={}", lib_);
- }
- Ok(())
- }
- Err(err) => Err(err),
- }
-}
-
-Generated by gir (https://github.com/gtk-rs/gir @ d1e88f94)
-from gir-files (https://github.com/gtk-rs/gir-files @ b20abec)
+Generated by gir (https://github.com/gtk-rs/gir @ 60cbef05)
+from gir-files (https://github.com/gtk-rs/gir-files @ e51adaf)
pub type OstreeRepoMode = c_int;
pub const OSTREE_REPO_MODE_BARE: OstreeRepoMode = 0;
pub const OSTREE_REPO_MODE_ARCHIVE: OstreeRepoMode = 1;
+pub const OSTREE_REPO_MODE_ARCHIVE_Z2: OstreeRepoMode = 1;
pub const OSTREE_REPO_MODE_BARE_USER: OstreeRepoMode = 2;
pub const OSTREE_REPO_MODE_BARE_USER_ONLY: OstreeRepoMode = 3;
//=========================================================================
// OstreeCollectionRef
//=========================================================================
+ #[cfg(any(feature = "v2018_6", feature = "dox"))]
pub fn ostree_collection_ref_get_type() -> GType;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
pub fn ostree_collection_ref_new(collection_id: *const c_char, ref_name: *const c_char) -> *mut OstreeCollectionRef;
//=========================================================================
// OstreeCommitSizesEntry
//=========================================================================
+ #[cfg(any(feature = "v2020_1", feature = "dox"))]
pub fn ostree_commit_sizes_entry_get_type() -> GType;
#[cfg(any(feature = "v2020_1", feature = "dox"))]
pub fn ostree_commit_sizes_entry_new(checksum: *const c_char, objtype: OstreeObjectType, unpacked: u64, archived: u64) -> *mut OstreeCommitSizesEntry;
//=========================================================================
// OstreeRemote
//=========================================================================
+ #[cfg(any(feature = "v2018_6", feature = "dox"))]
pub fn ostree_remote_get_type() -> GType;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
pub fn ostree_remote_get_name(remote: *mut OstreeRemote) -> *const c_char;
//=========================================================================
// OstreeRepoFinderResult
//=========================================================================
+ #[cfg(any(feature = "v2018_6", feature = "dox"))]
pub fn ostree_repo_finder_result_get_type() -> GType;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
pub fn ostree_repo_finder_result_new(remote: *mut OstreeRemote, finder: *mut OstreeRepoFinder, priority: c_int, ref_to_checksum: *mut glib::GHashTable, ref_to_timestamp: *mut glib::GHashTable, summary_last_modified: u64) -> *mut OstreeRepoFinderResult;